<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>添加文档</title>
		<script charset="utf-8" src="editor/kindeditor.js"></script>
		<script>        
			KE.show(
				{
					id : 'article_content',
					resizeMode : 1,
					imageUploadJson : '../../../manage/upload_json_struts2.jsp',
					fileManagerJson : '../../../editor/jsp/file_manager_json.jsp',
					allowFileManager : false,
					afterCreate : function(id) {
						KE.event.ctrl(document, 13, function() {
							KE.util.setData(id);
							document.forms['main_form'].submit();
						});
						KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
							KE.util.setData(id);
							document.forms['main_form'].submit();
						});
					},
					items : ['justifyleft', 'justifycenter', 'justifyright','justifyfull', 
							'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 
							'subscript','superscript', '|', 'selectall', '-','title', 'fontname', 'fontsize', '|', 
							'textcolor', 'bgcolor', 'bold','italic', 'underline', 'strikethrough', 'removeformat', '|', 
							'image', 'advtable', 'hr', 'emoticons', 'link', 'unlink']
					}
			);
		</script>
	</head>
	<body>
		<h1>
			添加${category.name}
		</h1>
		<s:form action="article/addArticle.action" method="POST" theme="simple" id="main_form" class="table_item" enctype="multipart/form-data">
			<input type="hidden" name="article.cid" value="${cid}"/>
			<input type="hidden" name="cid" value="${cid}"/>
			<table>
				<tbody>
					<tr>
						<th>
							标题：
						</th>
						<td>
							<s:textfield name="article.title" cssClass="input_long"></s:textfield>
						</td>
					</tr>
					<s:if test="cid==2">
					<tr>
						<th>
							图片：
						</th>
						<td>
							<s:file name="articleImage" cssClass="input_long"></s:file>
						</td>
					</tr>
					</s:if>
					<tr>
						<th>
							附件：
						</th>
						<td>
							<s:file name="articleFile" cssClass="input_long"></s:file>
						</td>
					</tr>
					<tr>
						<th>
							内容：
						</th>
						<td>
							<s:textarea id="article_content" name="article.content" cols="75" rows="30"></s:textarea>	
						</td>
					</tr>
					<tr>
						<td>
						</td>
						<td>
							<s:submit value="提    交"></s:submit>
						</td>
					</tr>
				</tbody>
			</table>
		</s:form>
	</body>
</html>